package org.footito.android.tools;

import java.io.File;

import org.footito.android.data.Team;

import android.os.Environment;
import org.footito.android.tools.Log;

public class Tools {

	public static void checkFilesFolder() {
		File f = Environment.getExternalStorageDirectory();
		// methode pour tester l'existence
		if (f.exists()) {
			Log.e("Exist: " + "scdard");
		} else {
			Log.e("No Exist: " + "scdard");
		}
		if (f.canWrite()) {
			f = new File(Team.PICTURE_FOLDER);
			Log.e("Can write: " + "name:" + f.getName() + " path:" + f.getPath());
			if (!f.exists()) {
				Log.e("Mkdir: " + f.mkdirs());
				if (f.canWrite()) {
					Log.e("Infos: " + "name:" + f.getName() + " path:" + f.getPath());

				} else {
					Log.e("Can write: " + f.getName());
				}
			} else {
				Log.e("Not exist: " + f.getName());
			}

		} else {
			Log.e("Can not write !: " + "scdard");
		}
	}
}
